//
//  WarnText.swift
//  Trans
//
//  Created by zcj on 2025/2/18.
//
import AppKit
import SwiftUI

struct WarnText: View {
    @State var textStr:String = "no message"
    var winId:WinId = 0
    var size:CGSize = NSMakeSize(500, 500)
    var body: some View {
        VStack{
//            TextEditor(text: $textStr).disabled(true)
            Text(textStr)
            .lineLimit(nil)
            .frame(width: size.width,height:size.height - 60,alignment: .top)
            
            Button {
                WindowDelegate.shared.closeWindowWithId(id: winId)
            } label: {
                Text("确定").frame(width: size.width/2,height: 35,alignment: .bottom)
            }.nomalStyle()

        }.frame(width: size.width,height: size.height)
    }
}

#Preview {
    WarnText()
}
